package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.OrderTicketStatus;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;


@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_group_purchase")
public class OrderGroupPurchaseEntity implements Serializable {
    /**
     * 未支付超时失效时长（秒）
     */
    public static long UNPAID_COUNTDOWN = 60;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    private Long orderId;
    
    private Long filmScheduleId;
    
    private OrderTicketStatus ticketStatus;
    private String ticketOrderNo;
    
    private BigDecimal ticketPrice;
    
    private String takeCode;
    
    private String remark;

    private Long userId;
    
    private Long cinemaId;
    
    private Long tenantId;
    
    private Integer ticketCount;

    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    @TableField(exist = false)
    private String filmName;
    
    @TableField(exist = false)
    private String filmLang;
    
    @TableField(exist = false)
    private String filmVersion;
    
    @TableField(exist = false)
    private String hallName;
    
    @TableField(exist = false)
    private LocalDateTime sessionStartTime;
    
    @TableField(exist = false)
    private LocalDateTime sessionEndTime;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "订单号")
    private String orderNo;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付价格")
    private BigDecimal payPrice;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付状态")
    private Short payStatus;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付类型")
    private Short payType;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "支付时间")
    private LocalDateTime payTime;
    
    @TableField(exist = false)
    @ApiModelProperty(value = "订单创建时间")
    private LocalDateTime orderCreatedAt;
    
    @TableField(exist = false)
    private OrderGroupPurchaseDetailEntity detail;
    
    @TableField(exist = false)
    private UserEntity user;

    @TableField(exist = false)
    private FilmScheduleEntity schedule;

}
